This one is mildly optimized for cycles compared to my second submission